package com.zqq.goods.service.impl

import com.zqq.baselibrary.ext.convert
import com.zqq.goods.service.CategoryService
import com.zqq.goods.service.bean.Category
import com.zqq.goods.service.repository.CategoryRepository
import rx.Observable
import javax.inject.Inject

/**
 * 商品分类 业务层 实现类
 * wc
 * @author zqq on 2018/8/1
 */
class CategoryServiceImpl @Inject constructor() : CategoryService {

    @Inject
    lateinit var repository: CategoryRepository

    /**
     * 获取商品分类列表
     */
    override fun getCategory(parentId: Int): Observable<MutableList<Category>?> {
        return repository.getCategory(parentId)
                .convert()
    }

}